﻿using System;
using System.Text;
using System.Linq;
using System.IO;
using System.Collections.Generic;
using System.Collections;

namespace L32Assembler.Registers
{   
    struct Registers
    {
        public object Ahold;
        public object A
        {
            get 
            {
                return this.Ahold;
            }
            set 
            {
                this.Ahold = value;
            }
        }
        private object Bhold;
        public object B
        { 
            get
            {
                return this.Bhold;
            }
            set 
            {
                this.Bhold = value;
            }
        }
        private object Chold;
        public object C
        {
            get 
            {
                return this.Chold;
            }
            set
            {
                this.Chold = value;
            }
        }
        private object Dhold;
        public object D
        {
            get 
            {
                return this.Dhold;
            }
            set
            {
                this.Dhold = value;
            }
        }
        private object Shold;
        public object S
        { 
            get
            {
                return this.Shold;
            }
            set
            {
                this.Shold = value;
            }
        }
        private object AHhold;
        public object AH
        {
            get 
            {
                return this.AHhold;
            }
            set 
            {
                this.AHhold = value;
            }
        }
        private object BLhold;
        public object BL
        {
            get
            {
                return this.BLhold;
            }
            set
            {
                this.BLhold = value;
            }
        }



        private ArrayList stack;
        public void InitializeComponent()
        {
            this.stack = new ArrayList();
            this.A = "";
            this.B = "";
            this.C = "";
            this.D = "";
            this.S = "";
            this.AH = "";
            this.BL = "";

        }
        public void PUSHA()
        {
            stack.Add(this.A);
            stack.Add(this.B);
            stack.Add(this.C);
            stack.Add(this.D);
            stack.Add(this.S);
            stack.Add(this.AH);
            stack.Add(this.BL);
        }
        public void POPA()
        {
            this.A = this.stack[0];
            this.B = this.stack[1];
            this.C = this.stack[2];
            this.D = this.stack[3];
            this.S = this.stack[4];
            this.AH = this.stack[5];
            this.BL = this.stack[6];
        }
    }
}